import 'package:flutter/material.dart';

import '../../generated/assets.dart';

class RadioButton extends StatelessWidget {
  final String value;
  final String? groupValue;
  final ValueChanged<String>? onChanged;

  const RadioButton({
    super.key,
    required this.value,
    this.groupValue,
    this.onChanged,
  });

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () {
        onChanged?.call(value);
      },
      child: SizedBox(
        width: 20.0,
        height: 20.0,
        child: Center(
          child: groupValue == value
              ? Image.asset(Assets.iconCheckedAudio)
              : Image.asset(Assets.iconUncheckedAudio),
        ),
      ),
    );
  }
}
